# == Schema Info
# Schema version: 20091029102158
#
# Table name: pages
#
#  id           :integer(4)      not null, primary key
#  structure_id :integer(4)      not null
#  content      :text(16777215)
#  slug         :string(50)      not null
#  title        :string(255)     not null
#  created_at   :datetime
#  updated_at   :datetime

class Page < ActiveRecord::Base
  validates_presence_of :title, :content
  
  translates :title, :content
  
  belongs_to :structure
  
  #has_one :header, :as=>:headerable, :dependent=>:destroy
  has_slug
  
  before_save :update_date
  
  def update_date
    self.updated_at = DateTime.now
  end
end
